<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="layouts::header"></head>

<body>
<nav th:replace="layouts::navbar"></nav>
    <div class="container">
        <h3>图书目录</h3>
        <hr>
        <!--新增学生按钮-->
        <a th:href="@{/newBooks/new}" class="btn btn-primary btn-sm mb-3">新增图书</a>
        <br>
        <table class="table table-bordered table-striped">
            <thead class="thread-dark">
                <tr>
                    <th>图书名称</th>
                    <th>图书类型</th>
                    <th>图书编号</th>
<!--                    <th>借出时间</th>-->
<!--                    <th>归还时间</th>-->
                    <th>修改</th>
                </tr>
            </thead>
            <tbody>
                <tr th:each="aNewBook : ${newBooks}">
                    <td th:text="${aNewBook.name}"></td>
                    <td th:text="${aNewBook.type}"></td>
                    <td th:text="${aNewBook.number}"></td>
                    <td>
                        <a th:href="@{/newBooks/update(id=${aNewBook.newBookId})}" class="btn btn-success btn-sm">更新</a>
                        <a
                            th:href="@{/newBooks/delete(id=${aNewBook.newBookId})}"
                            class="btn btn-danger btn-sm"
                            onclick="if (!(confirm('确定要删除这本书吗？'))) return false"
                        >删除</a>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</body>
</html>